<!--#include file="classData.asp"-->
<%
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache" 
Response.AddHeader "Pragma", "No-Cache"



	CurrentGroup = Request.QueryString("CurrentGroup")
	SeasonNum = Request.QueryString("SeasonNum")
	gf = Request.QueryString("gf")
	gs = Request.QueryString("gs")

	Select Case CurrentGroup
	
'		Case 65 'A
'			gfId = "95101"
'			gsId = "95109"
'		Case 66 'B
'			gfId = "95110"
'			gsId = "95102"
'		Case 67 'C
'			gfId = "95103"
'			gsId = "95111"
'		Case 68 'D
'			gfId = "95112"
'			gsId = "95104"
'		Case 69 'E
'			gfId = "95105"
'			gsId = "95113"
'		Case 70 'F
'			gfId = "95114"
'			gsId = "95106"
'		Case 71 'G
'			gfId = "95107"
'			gsId = "95115"
'		Case 72 'H
'			gfId = "95116"
'			gsId = "95108"

		Case 65 'A
			gfId = "95201"
			gsId = "95205"
		Case 66 'B
			gfId = "95206"
			gsId = "95202"
		Case 67 'C
			gfId = "95203"
			gsId = "95207"
		Case 68 'D
			gfId = "95208"
			gsId = "95204"

	
	End Select





	set HuaObj = new sysData
	HuaObj.sqlConnOpen()
	
	HuaObj.p_DbConnection.BeginTrans
	on error resume next


	InsertSql = "UPDATE AreaCup SET ManagerId ="&gf&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 12 AND ManagerId = "&gfId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE AreaCup SET ManagerId ="&gs&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 12 AND ManagerId = "&gsId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE AreaCup SET IfDone = 1 WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 1 AND ManagerId = "&gf
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE AreaCup SET IfDone = 2 WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 1 AND ManagerId = "&gs
	HuaObj.SCommand(InsertSql)


	InsertSql = "UPDATE CupPlan SET HomeId ="&gf&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 12 AND HomeId = "&gfId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE CupPlan SET AwayId ="&gf&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 12 AND AwayId = "&gfId
	HuaObj.SCommand(InsertSql)


	InsertSql = "UPDATE CupPlan SET HomeId ="&gs&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 12 AND HomeId = "&gsId
	HuaObj.SCommand(InsertSql)

	InsertSql = "UPDATE CupPlan SET AwayId ="&gs&" WHERE SeasonNum = "&SeasonNum&" AND CupLevel = 12 AND AwayId = "&gsId
	HuaObj.SCommand(InsertSql)


	response.ContentType="text/xml"	
	Response.Write("<?xml version=""1.0"" encoding=""gb2312""?>"&vbcrlf)
	Response.Write("<xml>"&vbcrlf)


	if err.number =0 then  
    	HuaObj.p_DbConnection.CommitTrans  '如果没有conn错误，则执行事务提交
		Response.Write("<Shi ShiId = ""1"">"&vbcrlf)
		Response.Write("</Shi>"&vbcrlf)
	else 
    	HuaObj.p_DbConnection.RollbackTrans '否则回滚
		Response.Write("<Shi ShiId = ""0"">"&vbcrlf)
		Response.Write("</Shi>"&vbcrlf)
	end if

	Response.Write("</xml>"&vbcrlf)

	
	HuaObj.sqlConnClose()


%>
